#include<iostream>
#include<unordered_map>
using namespace std;

class Solution {
public:
    int rearrangeCharacters(string s, string target) {
        int maze[26];
        int target_maze[26];
        for (int i = 0; i < 26; i++) {
            maze[i] = 0;
            target_maze[26] = 0;
        }
        for (int i = 0; i < s.length(); i++) {
            maze[s[i] - 'a'] ++;
        }
        int ans = 10000;
        for (int i = 0; i < target.length(); i++) {
            target_maze[target[i] - 'a'] ++;
        }
        for (int i = 0; i < 26; i++) {
            if (target_maze[i]) {
                ans = min(ans, maze[i] / target_maze[i]);
            }
        }
        return ans;
    }
};

int main() {
    return 0;
}

/**
 * 2023.1.13
 * 模拟
*/